import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';

export default class ImageSliderComponent extends Component {
  @tracked currentIndex = 0;

  @action
  next() {
    this.currentIndex = (this.currentIndex + 1) % this.args.images.length;
  }

  @action
  prev() {
    this.currentIndex =
      (this.currentIndex - 1 + this.args.images.length) %
      this.args.images.length;
  }
}
